<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlertTableAddProductKindColumn extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->unsignedTinyInteger('kind')->index('idx_kind')->default(1)->after('categoryId')
                  ->comment('菜品属性-种类: 1标准菜品 2自定义');
            $table->unsignedBigInteger('shopId')->index('idx_shopId')->default(0)->after('brandId')
                  ->comment('绑定的门店 id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->dropColumn('kind');
            $table->dropColumn('shopId');
        });
    }
}
